Repository navigation
fix(studio): a permission set's review link opens the draft review on its matrix page - #37347
Conversation
…on its matrix page The generic item page's review sheet and its ?review=1 arrival move into DraftReviewSheet / useDraftReviewArrival; PermissionMatrixEditPage (Studio's permission-set page and the routed one) uses both. Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
…e, the routed matrix and both producers Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
…ts callbacks refresh in an effect Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
| Mutation | Result |
|---|---|
A1: matrix arrival enabled: true changed to false |
5 red: both Studio review pins, both producer pins, the no-draft address pin. Both CONTROLs green. |
A3: generic page enabled: !createMode changed to false |
2 red: detailTabs ?review=1 opens the review and is consumed, and its CONTROL |
A4: the hook's next.delete(DRAFT_REVIEW_PARAM) removed |
6 red: detailTabs ×2, Studio address pin, both producer pins, the no-draft pin |
A5 (mine, not in the report): matrix hasDraft forced to false |
4 red: both producer pins, Studio review pin, Studio editing pin. The no-draft pin and both CONTROLs stay green. |
The dev's A1, A3 and A4 counts reproduce exactly.
Check-runs at head. 51 runs: 38 success, 13 skipped (all expected-skip per l1-face), 0 failed, 0 pending, and no legacy commit status. Lint & Repo Gates, TypeScript Type Check, Lint UI, Type Check UI, Test UI, Check Changeset and Governed Surface Queue Guard are all success.
Merge state.
git merge-tree --write-treeagainst origin/main134b71dbis clean (exit 0). No file is shared with main's 7 new commits.- feat(ui): New Package offers 「同时创建应用」 / Also create an app, ticked by default #37338 (
PackagesPage.tsx) and feat(studio): the left menu reads the placement table — 常用 types first, the rest in one 「高级」 fold #37341 landed in between and touch neighbouring files only. - Overlap with fix(console): "customized" means overrides + extensions everywhere; Setup → Packages names arrangements apart #37351 (
c9c1d9e4) and fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348 (7e57a1c7): none of their files are in this diff. The pairwisemerge-treeon top of main+fix(studio): a permission set's review link opens the draft review on its matrix page #37347 is clean for both. - Both PRs touch components this PR's new test renders:
PackageCustomizationsPanel(insidePackageDetailSheet) andStudioAreaAppOpen(StudioAreaAppGatearoundAreaItemOpen). So I built a local tree of main + fix(studio): a permission set's review link opens the draft review on its matrix page #37347 + fix(console): "customized" means overrides + extensions everywhere; Setup → Packages names arrangements apart #37351 + fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348, rebuilt the deps closure on it, and ran the 6 suites above plusPackagesPage.installedAppsUpdates-34722andStudioAreaAppOpen-36906:Test Files 8 passed (8),Tests 264 passed (264).
K = 7 (origin/main 134b71db). It was 6 at the zone's finalize 2026-11-25T21:42Z; test(runtime): get_record_context answers one caller with the same bytes on the /mcp and stdio doors over a real kernel #37350 has landed since, and it is a runtime test. Under 15, so no merge of main is owed before queueing.
Contract review: not owed. Clause-②: no without a (narrowing) arm, no packages/spec/src/**, and no governed path among the 7 files. Not Tier H: under 3,000 lines and not governed. CI plus this seat read is the whole review.
Report evidence. Every gate reading in the report names f781168f. The two local timeouts (check:query-options-erasure, check:type-check-debt) are NOT MEASURED locally, and their CI jobs are success at head. The report's mcp_calls are all reads.
Findings
- S1 (should-fix) — The 维护者速读 understates the risk in 「出错会怎样」. It says 「矩阵编辑和其他类型的审阅不受影响」. After this PR, every other type's
?review=1arrival runs through the shareduseDraftReviewArrival, and every other type's review sheet renders throughDraftReviewSheet. A defect there would break the review link for every type, not only the permission set's. That outcome is what the extraction preserves (pinned by A3/A4), not a worst case it rules out. In the same bullet set, 「在软件包页点某个权限集草稿的「审阅」」 names a label the page does not show: the per-draft link readsTYPE · NAME(PackagesPage.tsx:1340). Body-only fix by the zone before landing, no head move. Suggested 「出错会怎样」: 「最坏情况是审阅链接打开后面板不弹出或内容不对:权限集之外,其他类型的审阅也改走同一段共享代码(已有测试钉住,行为不变);矩阵编辑不受影响。纯界面改动,直接撤回即可。」 and 「点某个权限集草稿的链接」 for the first bullet. - N1 — The "What changes" bullet says the arrival reads the draft "at the address its load reads". That holds for the published (layered) read only. The matrix's load reads a draft at the door's
packageIdalone (PermissionMatrixEditor.tsx:1159), while the arrival reads it atlayeredPackageId, else by name. The Acceptance notes already state the cross-package consequence. Wording only; nothing owed. - N2 — On the cross-package leg, where both producers land, the matrix under the sheet shows the published set while the sheet shows the draft. The matrix behaved this way before this PR, and the Acceptance notes record it. It is the more meaningful gap behind the parity question (below), not a defect of this PR.
- N3 — The chat pin re-states
DraftReviewNavigator's navigate call rather than mountingAppContent. The call is the same shape asAppContent.tsx:286, and the redirect is pinned separately inAppContent.setupMetadataStudio-28578. Accepted. - N4 —
reviewReadis not keyed onname. If one matrix instance were reused across sets, a stale read would remain, but it is closed. A new arrival setsloadingbefore it readshasDraft, so no stale review opens. Harmless.
Parity ux card (zone Q1 A)
I agree with A: no reopen chip in this PR, and no parity card filed now.
- The card's Done-when is the arrival, and it is met.
- There is no measured pull for a chip on the matrix header (startup no-diffusion axis).
- On Studio's package leg, the surface's Changes panel and pending count already reach the package's drafts.
- The producers' links stay where they were, so the review can be opened again.
If a card is filed later, scope it to the cross-package leg (N2): the matrix there shows the published set under a draft review, and that, not a missing chip, is what a user would trip on. That calls for a design ruling, so a needs-user-decision card, not a ux chip card.
Landing
- The zone lands it after the S1 body edit (no head move; the seat then posts a same-head delta ACCEPT). K = 7 < 15: no merge of main first. Changeset present. Not Tier H, and no contract review owed.
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H Landing · 2026-11-25T22:45Z · head
|
Fixes #37269
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A review link (
?review=1) on a permission-set draft now opens the draft review on the set's matrix page, the same review sheet the generic item page opens.ResourceEditPage'sSheetaroundDraftReviewPanel) moves intoDraftReviewSheet, and its?review=1arrival effect intouseDraftReviewArrival(read afresh, open once the read settles and a draft is pending, then drop?review=1with a history replace).ResourceEditPagenow uses both; its behaviour is unchanged and its existing pins (ResourceEditPage.detailTabs-36901) pass on the shared hook.?review=1.PermissionMatrixEditPageuses the same hook and sheet. That covers Studio'sStudioPermissionSetPage(which embeds the matrix, package leg) and the routed matrix on the cross-package leg, where both producers' links land (/studio/~all/metadata/permission/NAME?review=1, through Setup's metadata redirect).layeredPackageId: the page's package, else the route's?package=), else by name alone, as the generic page reads a draft. The matrix's own load is not asked again, so an unsaved matrix edit is kept, and the matrix stays editable under the sheet and after it closes.?review=1still leaves the address. No published set readable: no review (nothing to compare against).?review=1the matrix reads exactly what it read before.?review=1is dropped the way the generic page drops it;AreaItemOpendecides its page once per item (StudioMetadataArea.tsx), so dropping the query does not move the set off its matrix page. No routing changed.PackagesPage.tsx,AppContent.tsx), the flow and object review links,StudioMetadataArea.tsx, server, spec and routes. No locale key added.Changeset:
.changeset/37269-permission-set-review-link.md(@object-ui/app-shellpatch).Read first (by risk)
ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx, the new block aboveconst [draft, setDraft]: the arrival's own draft and published read, and the sheet added todialogsEl.ui/packages/app-shell/src/views/metadata-admin/useDraftReviewArrival.ts: the arrival effect moved out ofResourceEditPage; callbacks are read through a ref refreshed in an effect that runs before the arrival effect.ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx: the inline effect and sheet replaced by the shared hook and component.Two-minute verification
On a showcase dev server, open Setup, then Packages, then a package with a pending permission-set draft, and click that draft's link. Expected: Studio opens the set's matrix with a right-hand sheet titled "Draft review" listing the changed keys, and the address no longer carries
review=1.Tests
New pins, all at head of this branch:
StudioPermissionSetPage.fullScreen-36905.test.tsx, new top-leveldescribe(the real Studio page and matrix):?review=1shows the draft's change against the published set (onlylabeldiffers), read at the page's package, then leaves the address;?review=1, a set with a pending draft opens no review, and the matrix's load is the only draft read.permissionReviewLinks-37269.test.tsx(new; the realPackageDetailSheet, the realStudioMetadataAreaon the cross-package leg, the real matrix registered as the type'sEditPage):setupMetadataStudioPath(item, 'review=1'), asDraftReviewNavigatorcalls it) reaches the same;?review=1opens no review and reads no draft;?review=1still leaves the address.StudioMetadataArea.routes-28561), the generic page's review (ResourceEditPage.detailTabs-36901), the redirect tables (setupMetadataRedirect,AppContent.setupMetadataStudio-28578).Runs (head f781168)
@object-ui/app-shelltype-check(both programs,tsc --noEmitandtsconfig.test.json): os-verify-lockVERDICT command-exit 0(at the feature commit; the later refactor commit only moved the hook to its own module, andeslinton the moved files is clean).?review=1or the review panel (11 files):Test Files 11 passed (11),Tests 281 passed (281),VERDICT command-exit 0.ResourceEditPage.*,PermissionMatrixEditor.*andStudioPermissionSetPage.*suite (113 files):Test Files 113 passed (113),Tests 664 passed (664),VERDICT command-exit 0.eslinton the changed files: 0 errors; no warning on a changed line.Ablations (one per pin, each through scripts/ablation-replace.mjs, restored to the HEAD blob with git diff HEAD empty)
enabled: truetofalseinPermissionMatrixEditor.tsx)useDraftReviewArrival.ts)ResourceEditPage.tsx)?review=1 opens the review and is consumed, and its CONTROL?review=1kept in the address (useDraftReviewArrival.ts)StudioMetadataArea.tsx)routes-28561Each leg ran the four suites (
StudioPermissionSetPage.fullScreen-36905,permissionReviewLinks-37269,ResourceEditPage.detailTabs-36901,StudioMetadataArea.routes-28561; 76 tests) under the lock; each mutation landed (anchor 1 to 0) and was restored to its HEAD blob.Acceptance notes
?review=1, as the generic page does; unlike the generic page it does not reload the editor, so a same-item arrival keeps unsaved matrix edits.Verification
Local, on
f781168f(exit code read before any pipe):pnpm check:test-source-alias: exit 0.pnpm --dir ui check:i18n-keys: exit 0.node scripts/pm/overlap-check.mjs: exit 0 (VERDICT clean; no open PR shares a file). With--pr=37341,37338: exit 0, both merge cleanly. Theclaude/issue-37236-*andclaude/issue-37237-*branches share no file with this diff.node scripts/pm/dispatch-gates.mjs --commandsderived 39 commands. At the time of writing 28 had run locally: 27 exit 0 (the changeset gates,check:nul-bytes,check:cross-package-test-inputs,check:adr-anchors,check:published-files,check:sdui-manifestamong them), andcheck:query-options-erasurehit the local 300 s wrapper timeout (exit 124): NOT MEASURED locally, left to CI. The rest, andpnpm --dir ui exec vitest run scripts/(this diff touches no script), are left to CI.CI: in progress at the time of writing.
Generated by Claude Code